#ifndef _SERVER_PROTO_H__
#define _SERVER_PROTO_H__

#include <stdint.h>
//#include "attr_id.h"
//#include "comm_define.h"
//#include "game_helper.h"
#pragma pack(1)

//除了broadcast的所有消息，第一个字段都是PROTO_HEAD, 最后一个字段都是EXTERN_DATA

typedef struct st_proto_head
{
    uint32_t len;     //长度
//    uint16_t seq;     //序号
	uint64_t player_id;
                      //	uint32_t crc;		//crc校验
	
    uint16_t msg_id;  //消息ID
    char data[0];     // PROTO 内容
} PROTO_HEAD;

typedef struct proto_head_conn_broadcast
{
    uint32_t   len;
    uint16_t   msg_id;
    uint16_t   seq;
    uint16_t   num_player_id;
    PROTO_HEAD proto_head;
    uint64_t   player_id[0];
} PROTO_HEAD_CONN_BROADCAST;

// server之间外带的数据
typedef struct extern_data
{
    uint64_t player_id;
    uint32_t open_id;
    uint16_t fd;
    uint16_t port;
} EXTERN_DATA;
#pragma pack()
#endif
